home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Shareware Grab Bag
/
Shareware Grab Bag.iso
/
007
/
jovept1.arc
/
CHANGES.DOC
< prev
next >
Wrap
Text File
|
1985-05-30
|
7KB
|
147 lines
JOVE/MS-DOS Changes.
K. Mitchum 4/85
The following is a brief list of the changes made in converting Jove
from Unix to MS-DOS. This is not a detailed list of exact code changes:
as will become clear, enough code was changed and moved so that a simple
"diff" of sources is ridiculous. Instead, this should serve as a guide
in case you are curious, want to change something, or have other code
you would like to move to MS-DOS.
Some of the changes to Jove are certainly "kludges", as will be apparant.
Since I did not write Jove, and had little time to decipher all that was
going on in the code, my aim was not elegance in transcription, or efficiency,
but in GETTING THE CODE TO WORK. By definition, this means that many of the
changes are simply forced kludges, and that there are places in the code
that may appear poorly written, redundant, or unnecessary. This is
particularly true in the terminal/screen output code, which is certainly
in need of some optimization. While I had meant to spend some time
"cleaning up" the code and redoing things, my schedule does not permit
this at present.
The changes to Jove were all done in cross-development. Code was changed
on a Berkeley 4.2 system, and tested, then moved to a MS-DOS system and
tested. Any changes necessary were then ported back to the Unix machine
and retested. While this "ping-pong" development took some extra time,
it helped in the discovery of the ways in which things on the two
systems differ, and in making the code more portable.
Two types of changes have been made to the sources: cosmetic changes and
functional changes. Cosmetic changes are changes in the WAY something is
written, i.e. to please a particular compiler or link. For example,
localizing and moving variable declarations to avoid to satisfy the C86
compiler's idea of "extern". Functional changes are changes to the code,
such as substituting a dedicated terminal/screen driver for the termcap
driver in the original Jove, or changing the behavior of "next-screen"
to look more like emacs.
1) Extensive changes were made to "jove.h" to organize declarations more
sensibly and to localize variable declarations to avoid duplicate
declaration messages from the MS-DOS compiler. This was necessary
because of the notion of "extern" maintained by C86. In addition, some
additional .h files were created, such as "funcs.h".
2) In the original Jove, terminal i/o was via termcap calls, and was
spread throughout the code. Because with MS-DOS a dedicated screen
driver is needed, all the terminal i/o was relocated and localized, with
provision for a dedicated driver which is modular to one file. Hence,
when moving the code from Unix to MS-DOS, changing the dedicated driver
is quite simple.
3) All functions with significant degrees of o.s. dependence were moved
to the end of each source file, while code which is identical between
systems, or has a one or two line change, is kept at the beginning of
each source file.
4) Everything in "format.c" using the variable argument function
_doprnt(), which is in assembly language on a Unix system, were changed
to usage of a similar function in the C86 library.
5) All character i/o was rewritten using simple bdos() calls in an
attempt to duplicate "raw" i/o action under Unix.
6) Sections of code requiring child processes were ifdeffed out. While
it may be possible, particularly with newer versions of MS-DOS, to
create a "shell" and run it's output to a window, most of the other Jove
functions requiring processes were deemed too complicated to emulate
under MS-DOS. Some of these may be emulated in the future, such as
running the compiler or "make" in a window, however, the single-process
nature of the o.s. makes this seem of dubious value.
7) All calls to signal() were ifdeffed.
8) An emulation of the Unix stat() call was provided to kludge an
inode number for each file.
9) A dedicated driver was substituted under Unix for the termcap
version, using both h19 and ann arbor ambassador terminals. A driver was
then written for MS-DOS along similar lines, using direct screen
management as a memory array, independent of the operating system.
10) An exhaustive search for all cases of innappropriate type
conversions was made. This was necessary because of the different sizes
of ints (16 bits) and pointers (32 bits) on the 8088. This took some
time, but cleared up some interesting errors.
11) Some problems with overflowing using strncpy(), which were not a
problem on the Unix machine were found and a local version was written.
12) Key bindings were changed to more closely match those of our version
of emacs.
13) The behavior of some routines, such as "next-page", "prev-page",
etc. was changed to more closely approximate emacs.
14) Changes were made in "c-mode" to more closely resemble electic-c
mode under emacs. Brace and bracket matching were added, with warnings
when the matches are not in the current window.
15) Some of the optimizing routines in the screen handler were made
operating system dependent. Significant degrees of simplication can
still be made, however, since with a memory image of the screen there is
no need for optimization at all.
16) Some minor changes were made to match across cases since all file
names under MS-DOS are returned in upper case.
TO DO:
1) There is a bug in the screen display that crops up occassionally when
doing single character deletes. The problem is one of display, since a
"redraw" will draw the screen correctly. I hope to look into this soon.
2) Because the screen redraw algorithm doesn't know about screen
highlighting, when the same character at the same position on the screen
needs to be redone using a different highlight, it is not done. This is
only apparant when deleting windows from the screen, when a character
that was on the mode line (in highlight) should be redrawn without
highlight.
3) VERY RARELY, a fast typist can string together a string of control
characters including a control C, particularly ^X-^S-^C, that will be
intercepted by the operating system, aborting the program and ERASING
a file. Because this has happened only twice in 6 months of continuous
use of Jove on 4 different systems, it is hard to find the fix. However,
be warned: type control sequences distinctly at a reasonable speed.
4) When using a large number of files, buffers, and making many changes
at one session an occassional "free node in list" error may pop up.
This has happened rarely, and the cause in unclear. If you cure this
one, let me know. Your files are not munged when this happens.
5) There is no backup file facility ala emacs, or checkpointing. I hope
to add this soon.
6) When you invoke Jove and specify a filename, i.e. "jove foobar.c", or
are within jove and do a "visit-file" or the like, the mode gets set
correctly. However, if you are already in a buffer and read in a new
file, the mode does not get reset automatically. Again I intend to look
at this someday.
7) A tags package needs to be implemented and tested. The code is there.